package redora.test.rdo.gwt.mvp.service;

import com.google.gwt.json.client.JSONObject;

import redora.client.mvp.ClientFactory;

import redora.test.rdo.gwt.mvp.service.base.JUnitMasterServiceBase;
import redora.test.rdo.gwt.mvp.util.ClientFactoryImpl;

/**
* Service object for JUnitMaster that will do the communication with the server.
* Implemented as singleton to allow caching of objects on the client side.<br>
* Redora has generated the standard service methods in {@link JUnitMasterServiceBase},
* you can add your custom methods here.
*
* @author Redora (www.redora.net)
*/
public class JUnitMasterService extends JUnitMasterServiceBase {

    //As singleton: allows to cache result sets and pojos
    private static JUnitMasterService instance;
    private JUnitMasterService(ClientFactory clientFactory) {
        super(clientFactory);
    }
    public static synchronized JUnitMasterService getInstance() {
        if (instance == null)
            instance = new JUnitMasterService(new ClientFactoryImpl());
        return instance;
    }

    @Override
    public int finderStepSize() {
        return 50;
    }

    @Override
    public String getAuthInfo() {
        return null;
    }

    @Override
    public boolean customResponse(int status, JSONObject responseJSON) {
        return true;
    }
}